/**
 * 
 */
package br.com.estrategos.modelo.localidade;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.ForeignKey;

/**
 * @author x12259401
 * 
 */
@MappedSuperclass
public abstract class Estado {

	@Id
	@GeneratedValue
	@Column(name = "idestado", unique = true, length = 10)
	private Long id;

	@Column(name = "nome", unique = true, length = 45)
	private String nome;
	
	@Column(name = "uf", unique = true, length = 2)
	private String uf;

	@Column(name = "dtcadastro")
	private Date dtCadastro;

	@ManyToOne(targetEntity = PaisEntity.class, fetch = FetchType.LAZY)
	@ForeignKey(name="fk_idpais")
	@JoinColumn (name = "idpais", nullable=false)
	private PaisEntity pais;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public PaisEntity getPais() {
		return pais;
	}

	public void setPais(PaisEntity pais) {
		this.pais = pais;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Date getDtCadastro() {
		return dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}

	public String getUf() {
		return uf;
	}

	public void setUf(String uf) {
		this.uf = uf;
	}
	

}
